import Vue from 'vue'
import moment from 'moment'

Vue.filter('ActorToStr', (arr , len = 20) => {
    let str = "无";
      if (Array.isArray(arr) && arr.length > 0) {
        str = arr.map((item) => item.name).join(" ")
        str = str.length > len ? (str.substr(0 , len) + '...') : str
      }
      return str;
})

Vue.filter('fmtDate' , value => {
  return moment(value * 1000).format('YYYY-MM-DD')
})

Vue.filter('money' , value => {
  let money = ''
  return money = parseFloat(value / 100)
})